﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Domain.Model.Abstract;

namespace Domain.Model
{
    public class Program : PortfolioItem
    {
        #region Properties

        public virtual IList<Project> Projects { get; set; }

        #endregion

        #region Constructor

        public Program(string name, string description)
            : base(name, description)
        {
            Projects = new List<Project>();
        }

        public Program()
            : this("new program", "this is a new program")
        { }

        #endregion

        #region public methods

        public virtual void AddProject(Project project)
        {
            project.Program = this;
            Projects.Add(project);
        }

        public virtual void DeleteProject(Project project)
        {
            project.Program = null;
            Projects.Remove(project);
        }

        #endregion
    }
}